package org.ftc.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.ftc.form.TreeForm;


@Entity
@Table(name = "SESSION")
//@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Session extends BasicEntity implements Serializable {
	

	/**
	 * 
	 */
	private static final long serialVersionUID = -9163620624709275875L;

	@Id 
	@Column(name = "SESSION_NO", length = 6 , unique = true)
	private String sessionNo;
	
	@Column(name = "YEAR", length = 3 ) 
	private String year;
	
	@Column(name = "MONTH", length = 2 ) 
	private String month;
	
	@Column(name = "DAY", length = 2 ) 
	private String day;
	
	@Temporal(TemporalType.DATE)
	@Column(name = "MEETING_DATE" ) 
	private Date meetingDate;
	
	@Column(name = "RECORDER", length = 50 ) 
	private String recorder;
	
	@Column(name = "COMMITTEE_TEAM", length = 50 ) 
	private String committeeTeam;
	
	public String getSessionNo() {
		return sessionNo;
	}

	public void setSessionNo(String sessionNo) {
		this.sessionNo = sessionNo;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public String getMonth() {
		return month;
	}

	public void setMonth(String month) {
		this.month = month;
	}

	public String getDay() {
		return day;
	}

	public void setDay(String day) {
		this.day = day;
	}

	public Date getMeetingDate() {
		return meetingDate;
	}

	public void setMeetingDate(Date meetingDate) {
		this.meetingDate = meetingDate;
	}
	
	public String getRecorder() {
		return recorder;
	}

	public void setRecorder(String recorder) {
		this.recorder = recorder;
	}

	public String getCommitteeTeam() {
		return committeeTeam;
	}

	public void setCommitteeTeam(String committeeTeam) {
		this.committeeTeam = committeeTeam;
	}
	
	public TreeForm transferTree(){
		TreeForm treeForm = new TreeForm();
		treeForm.setId(this.sessionNo);
		treeForm.setText(this.sessionNo);
		treeForm.setName(this.sessionNo);
		treeForm.setState("open");
		return treeForm;
		
	}
	
}
